package com.example.designPattern.adapter.objectAdapter;

/**
 * 类适配器   相当于手机充电器转接头
 *
 * 它将220v的电压转成5v后使用
 */
public class VoltageAdapter  implements IVoltage5V {

    private Voltage220V voltage220V;

    public VoltageAdapter(Voltage220V voltage220V){
        this.voltage220V = voltage220V;
    }
    @Override
    public int output5V() {
        int voltage = voltage220V.output220V() / 44;
        return voltage;
    }
}
